package com.heima.shopweb.service;

import com.zijie.core.util.JsonResult;
import com.zijie.members.model.Members;
import org.springframework.boot.json.JsonWriter;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "shop-gateway",contextId = "member-feign")
public interface MemberFeignService {
    //根据账号去查询用户
    @GetMapping("/members-api/api/v1/member/findByPhone/{phone}")
    ResponseEntity<JsonResult<Members>> findByPhone(@PathVariable("phone") String phone);
    //根据id去寻找用户
    @GetMapping("/members-api/api/v1/member/{id}")
    ResponseEntity<JsonResult<Members>> findById(@PathVariable("id") Integer id);

    //更新用户地址
    @PutMapping("/members-api/api/v1/member/update")
    ResponseEntity<JsonResult<Members>> update(@RequestBody Members members);
}
